home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 551-575 / disk_558 / disdf / disdf.doc < prev    next >
Text File  |  1992-05-06  |  7KB  |  194 lines

  1.  
  2. /* DisDF.doc V1.1
  3.  
  4. NAME
  5.     DisDF
  6.  
  7. SYNOPSIS
  8.     DisDF [0] [1] [2] [3] [c] [-d|e|s] [-f] [-h] [v]
  9.  
  10. DESCRIPTION
  11.                 For those who don't use floppies much
  12.                 and for whom NoClick is ineffective
  13.  
  14.                 stops that empty floppy drive noise !!!
  15.                 by disabling the floppy drive tasks.
  16.  
  17.  When called a first time, or anytime with the disable option, DisDF
  18.  removes each specified floppy drive's 'trackdisk.device' task from
  19.  exec's task lists and moves it to the tail of the TaskWait list in the
  20.  TS_REMOVED state so that it never runs, thus disabling the floppy drive.
  21.  
  22.  When called a second time, or anytime with the enable option, DisDF moves
  23.  each specified floppy drive's 'trackdisk.device' task to the tail of the
  24.  TaskReady list in the TS_WAIT state so that it can run, thus re-enabling
  25.  the floppy drives.
  26.  
  27.  DisDF also changes a disabled 'trackdisk.device' task's priority to -123 so
  28.  that it can be spotted as disabled in task lists where task states aren't
  29.  shown.
  30.  
  31.  options
  32.    #  floppy drive number to enable or disable.
  33.       Default is all drives DF0: to DF3:.
  34.  
  35.   -c  change priorities only and run a higher priority busyloop task.
  36.       See 'warnings' below.
  37.  
  38.   -d  disable (instead of toggle).
  39.       If no drives are specified, all will be disabled.
  40.  
  41.   -e  enable (instead of toggle).
  42.       If no drives are specified, all will be enabled.
  43.  
  44.   -f  additionally disable the 'File System' task of a disabled drive.
  45.       ( this task uses CPU time even when the drive is disabled ).
  46.       See warnings below. Need not be specified when enabling the drive.
  47.  
  48.   -h  or any wrong argument puts usage to stdout, exits with Fail code 10.
  49.  
  50.   -s  status only; put current drive status messages to stdout, do not
  51.       modify drive tasks.
  52.  
  53.   -v  verbose; put drive status messages to stdout after tasks are modified.
  54.  
  55. RETURNS
  56.   Fail code and message :
  57.  
  58.   $0000 floppy disks disabled
  59.         floppy disks enabled
  60.         success; message if -d or -e option, otherwise silent.
  61.  
  62.   $000A Command line argument error; usage is put to stdout.
  63.         
  64.   $000B CreateExtIO() error
  65.   $000C CreatePort() error
  66.         these library functions called by DisDF can fail due to memory
  67.         shortage; try again.
  68.  
  69.   $000D no floppy drive found
  70.         DisDF calls OpenDevice() for DF0 to DF3; in case of error it
  71.         assumes that drive is not mounted; if none are mounted, it exits
  72.         with this message.
  73.        
  74.   ----- DFn not mounted
  75.         (message only) Drive DFn was specified in the command line but
  76.         is not mounted. 
  77.  
  78.   $000E not enough memory
  79.         an AllocMem call failed; try again. 
  80.  
  81.   Fail codes greater than $000F indicate a sum of failures as follows :
  82.  
  83.   $00x0 DFn device process missing.
  84.         DisDF failed to find for each mounted drive a device process 
  85.         using library function DeviceProc("DFn:");
  86.  
  87.   $0y00 DFn trackdisk.device task missing.
  88.         DisDF failed to find for each mounted floppy drive a trackdisk.
  89.         device task in exec's task lists.
  90.  
  91.   $z000 DFn File System task missing.
  92.         DisDF failed to find for each mounted floppy drive a File System
  93.         task in exec's task lists; this is the same task as the 'device
  94.         process' found above with DeviceProc().
  95.  
  96.   z, y, x above are each 8+4+2+1 for drives DF3+ DF2+ DF1+ DF0 respectively. 
  97.  
  98.   Such errors indicate that something went drastically wrong, and it is
  99.   probably best to reboot immediately unless you know why they occured.
  100.  
  101.   y and z errors can occur when some tasking utilities simply remove tasks
  102.   from exec's task lists to 'kill' or 'freeze' them, but leave their
  103.   associated structures in the system; in such cases, if the utility can
  104.   put the task back in a list ('warm' or 'ready' it), you probably needn't
  105.   reboot.
  106.      
  107.  
  108. EXAMPLES
  109.  DisDF           ;toggle all floppy drives off/on.
  110.  
  111.  DisDF -f        ;toggle all floppy drives off/on, also 'File System' tasks.
  112.  
  113.  DisDF -d        ;disable all floppy drives.
  114.  
  115.  DisDF -s        ;type current drive status to stdout.
  116.  
  117.  DisDF -d -f     ;disable all floppy drives and their 'File System' tasks.
  118.  
  119.  DisDF -e -v     ;enable all floppy drives and show status.
  120.  
  121.  DisDF 0 2       ;toggle DF0: and DF2: off/on, leave others unchanged.
  122.  
  123.  DisDF 0 2 -d -f ;disable DF0: and DF2: and their 'File System' tasks,
  124.                   leave other drives unchanged.
  125.  
  126.  DisDF -d 2 -f 0 ;same as above ( order of args is irrelevent ).
  127.  
  128.  DisDF 0 2 -e    ;enable DF0: and DF2:, leave other drives unchanged.
  129.  
  130.  DisDF -h
  131.  DisDF ?
  132.  DisDF 1 2 3 4   ;type usage to stdout ( 4 is invalid argument ).
  133.  
  134.  From the Workbench, use a project icon with default tool DisDF.
  135.   If you're not into workbench and icons but want to try this :
  136.    - from a CLI, Copy DH0:Pointer.info to DH0:DisDF.info;
  137.    - open DH0: on the workbench and click once on the new icon
  138.      (it's under the 'Pointer' icon...)
  139.    - select Info from the Workbench menu, opening a panel
  140.    - in the 'Default Tool' box type 'SYS:utilities/DisDF', or DisDF is
  141.    - delete the Tool Type with the 'Del' gadget
  142.    - exit the Info panel with 'Save'
  143.    - close and reopen DH0:
  144.   Double-clicking on the new icon  (it's still under the 'Pointer' icon...)
  145.   should now toggle the drives off/on.
  146.  
  147. AUTHOR
  148.  V1.0 July 22 1991, V1.1 Aug 4 1991 by
  149.  Patrick F. Misteli, 72 chemin Ami-Argand, 1290 Versoix Geneva, Switzerland.
  150.  Anyone who gets a hold of this is free to do whatever can be done with it.
  151.  
  152. WARNINGS
  153.  Do not use the -f (File System) option if running the Workbench.
  154.  
  155.  Do not use the -f (File System) option if you expect to run commands that
  156.  look for floppy drives, such as Info.
  157.  
  158.  These will hang if the File System tasks disabled.
  159.  
  160.  If this happens you must reboot unless :
  161.  -you can start another CLI ( with a hot key ) from which you can re-enable
  162.  the drives, or
  163.  -you installed DisDF under a hot key that enables all drives, e.g. a
  164.  "DisDF -e" script, or
  165.  -you can start a tasking utility that can move the File System tasks into
  166.  the TaskReady list, preferably with priority 10.
  167.  
  168.  LoadWB needs both the 'File System' and 'trackdisk.device' tasks,
  169.  so all drives must be enabled; if not, proceed as above.
  170.  
  171.  If you have qualms about DisDF's brutally modifying task states that
  172.  exec so carefully maintains, a 'system safe' alternative involves
  173.  running a busywait loop at priority -122, then setting the floppy drive
  174.  tasks' priority to -123 to disable the drives, and back to their normal
  175.  value to enable them. i.e run DisDF with the -c (chicken) option.
  176.  
  177. SEE ALSO
  178.  NoClick, TaskControl, Xoper, AskTask, TrackSalve, Who, Taskx.
  179.  
  180.  One can do the same as DisDF with programs such as TaskControl, Xoper, 
  181.  TrackSalve, and AskTask by 'freezing' the trackdisk tasks; some of these
  182.  can be run from a script, but stay resident (Xoper); or they remove the
  183.  tasks from the lists so that other tasks can't find them. Disabling a
  184.  particular drive might be a little tedious (use Who to get tasknumbers).
  185.  
  186. BUGS
  187.  "...?" ("The Shadow knows.")
  188.  
  189. V1.1 Aug 4 1991
  190.  fixed exit() to permexit() in addbusytask().
  191.  fixed exit codes to int.
  192.  
  193.  end DisDF.doc  ---------------------------------------------------------- */
  194.